package sg.edu.nus.iss.vmcs.customer;

import java.awt.Button;
import java.awt.event.*;

public class DrinkSelectionListener implements ActionListener {

	private TransactionController tCtrl;
	
	public DrinkSelectionListener(TransactionController tCtrl){
		this.tCtrl=tCtrl;
	}
	
	public void actionPerformed(ActionEvent e){
		Button btn;
		String cmd;
		int idx;

		btn = (Button) e.getSource();
		cmd = btn.getActionCommand();		
		idx = Integer.parseInt(cmd);
		tCtrl.startTransaction(idx);
	}
}
